import request from '@/utils/request'
import qs from 'qs'
/**@获取日历里程**/
export function getDistance(query) {
  return request({
    url: '/driving/queryMonthlyDrivingData?'+ qs.stringify(query),
    method: 'get'
  })
}

/**@获取设备统计**/
export function countTracker() {
  return request({
    url: '/tracker/countTracker',
    method: 'get'
  })
}


export function modifyTracker(params) {
  return request({
    url: '/tracker/modifyTracker',
    method: 'post',
    params
  })
}

/** @修改用户**/
export function updateUser(params) {
  return request({
    url: '/user/updateSysUser',
    method: 'post',
    params
  })
}

/** @添加用户**/
export function addSysUser(params) {
  return request({
    url: '/user/addSysUser',
    method: 'post',
    params
  })
}

/** @添加管理员用户**/
export function addTrackUser(params) {
  return request({
    url: '/user/addTrackUser',
    method: 'post',
    params
  })
}

/** @删除管理员用户**/
export function updateTrackUser(params) {
  return request({
    url: '/user/updateTrackUser',
    method: 'post',
    params
  })
}

/** @修改密码**/
export function updatePwd(params) {
  return request({
    url: '/user/modifyPassword',
    method: 'post',
    params
  })
}

/** @用户统计**/
export function queryUserOvew(params) {
  return request({
    url: '/user/queryUserOvew',
    method: 'get',
    params
  })
}

/** @最新警情**/
export function lastwarning(params) {
  return request({
    url: '/tracker/findNearlyWarnings',
    method: 'get',
    params
  })
}


/** @添加乐骑用户**/
export function addUser(params) {
  return request({
    url: '/user/addUser',
    method: 'post',
    params
  })
}


/** @禁止乐骑用户**/
export function forbidUser(params) {
  console.log(params)
  return request({
    url: '/user/updateUser',
    method: 'post',
    params
  })
}

